package com.baizhi.cmfz.service.impl;

import com.baizhi.cmfz.dao.AlbumDao;
import com.baizhi.cmfz.entity.Album;
import com.baizhi.cmfz.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AlbumServiceIml implements AlbumService {
    @Autowired
    private AlbumDao albumDao;

    @Override
    public Map showPageAlbum(int page, int limit) {
        int offset=(page-1)*limit;
        List<Album> list=albumDao.showPageAlbum(offset,limit);
        int count=albumDao.showCount();
        Map map=new HashMap();
        map.put("data",list);
        map.put("count",count);
        map.put("code",0);
        map.put("msg","");

        return map;
    }

    @Override
    public List<Album> showSix(int count) {
        return albumDao.showSix(count);
    }
}
